bitkeeper revision 1.1159.231.14 (41fa441azB6742PriyqlRlCP_gJ0Tw)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 28 Jan 2005 13:54:34 +0000 (13:54 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 28 Jan 2005 13:54:34 +0000 (13:54 +0000)
Build and x86/64 fixes.
Signed-off-by: keir.fraser@cl.cam.ac.uk
BitKeeper/etc/logging_ok
xen/arch/x86/Makefile
xen/arch/x86/boot/x86_64.S
xen/arch/x86/domain.c
xen/arch/x86/e820.c
xen/arch/x86/memory.c
xen/arch/x86/x86_32/xen.lds
xen/arch/x86/x86_64/xen.lds
xen/include/asm-x86/mm.h
xen/include/public/arch-x86_64.h

index d14c442f6658892862b117f71606b56b12cad128..9079494d08635b6ebe1967199e59d86bfceb075b 100644 (file)
@@ -26,6 +26,7 @@ iap10@tetris.cl.cam.ac.uk
 jws22@gauntlet.cl.cam.ac.uk
 jws@cairnwell.research
 kaf24@camelot.eng.3leafnetworks.com
+kaf24@firebug.cl.cam.ac.uk
 kaf24@freefall.cl.cam.ac.uk
 kaf24@labyrinth.cl.cam.ac.uk
 kaf24@pb001.cl.cam.ac.uk
index e6f6f561b50a250f77d2d6e56e342e9283afb5c6..342b8feba96cd9efd4b73ef6cd488f41fb9ac0d4 100644 (file)
@@ -15,6 +15,7 @@ OBJS := $(subst $(TARGET_SUBARCH)/asm-offsets.o,,$(OBJS))
 ifneq ($(TARGET_SUBARCH),x86_32)
 OBJS := $(subst vmx.o,,$(OBJS))
 OBJS := $(subst vmx_io.o,,$(OBJS))
+OBJS := $(subst vmx_platform.o,,$(OBJS))
 OBJS := $(subst vmx_vmcs.o,,$(OBJS))
 endif
 
index 875584126e4ec86ad2490c858a02f0e2205e0510..73a513f9b6ffa0b9a4efa89fbdc7cccf2bbd1312 100644 (file)
@@ -156,7 +156,8 @@ __high_start:
         lea     start(%rip),%rax
         sub     $0x100000,%rax
         add     %rax,%rdi
-        call    cmain
+        call    __start_xen
+        ud2     /* Force a panic (invalid opcode). */
 
 /* This is the default interrupt handler. */
 int_msg:
@@ -264,10 +265,9 @@ phys_to_machine_mapping:
 copy_from_user: 
 show_registers: 
 do_iopl: 
-.globl idt_table, copy_user_generic, memcmp, idt_tables, new_thread
+.globl idt_table, copy_user_generic, idt_tables, new_thread
 idt_table:
 copy_user_generic:
-memcmp:
 idt_tables:
 new_thread:
 .globl switch_to, __get_user_1, __get_user_4, __get_user_8, trap_init
index 8558c526275d928425e4b4cc22086bd237206236..6270c09985aaad90bb6bbf96b691e06c18c2e772 100644 (file)
@@ -364,8 +364,6 @@ static void monitor_rm_pagetable(struct exec_domain *ed)
     l2_pgentry_t *mpl2e;
     unsigned long mpfn;
 
-    ASSERT( m->monitor_table );
-    
     mpl2e = (l2_pgentry_t *) map_domain_mem(pagetable_val(m->monitor_table));
     /*
      * First get the pfn for guest_pl2e_cache by looking at monitor_table
@@ -510,8 +508,10 @@ int arch_final_setup_guestos(struct exec_domain *d, full_execution_context_t *c)
         }
     }
 
+#ifdef CONFIG_VMX
     if (c->flags & ECF_VMX_GUEST)
         return vmx_final_setup_guestos(d, c);
+#endif
 
     return 0;
 }
@@ -747,6 +747,7 @@ static void relinquish_list(struct domain *d, struct list_head *list)
     spin_unlock_recursive(&d->page_alloc_lock);
 }
 
+#ifdef CONFIG_VMX
 static void vmx_domain_relinquish_memory(struct exec_domain *ed)
 {
     struct domain *d = ed->domain;
@@ -776,6 +777,7 @@ static void vmx_domain_relinquish_memory(struct exec_domain *ed)
     }
 
 }
+#endif
 
 void domain_relinquish_memory(struct domain *d)
 {
@@ -788,15 +790,18 @@ void domain_relinquish_memory(struct domain *d)
     shadow_mode_disable(d);
 
     /* Drop the in-use reference to the page-table base. */
-    for_each_exec_domain(d, ed) {
+    for_each_exec_domain ( d, ed )
+    {
         if ( pagetable_val(ed->mm.pagetable) != 0 )
             put_page_and_type(&frame_table[pagetable_val(ed->mm.pagetable) >>
                                            PAGE_SHIFT]);
     }
 
-    if (VMX_DOMAIN(d->exec_domain[0]))
-        for_each_exec_domain(d, ed)
+#ifdef CONFIG_VMX
+    if ( VMX_DOMAIN(d->exec_domain[0]) )
+        for_each_exec_domain ( d, ed )
             vmx_domain_relinquish_memory(ed);
+#endif
 
     /*
      * Relinquish GDT mappings. No need for explicit unmapping of the LDT as 
index 50f1b5fc8b7b4957d3430ba43fea4a065ef2c6e2..cf78c2184428dc01a0a644060ee1083dce3bf255 100644 (file)
@@ -305,17 +305,11 @@ static unsigned long __init find_max_pfn(void)
     return max_pfn;
 }
 
-static void __init machine_specific_memory_setup(
-    struct e820entry *raw, int raw_nr)
+#ifdef __i386__
+static void __init clip_4gb(void)
 {
-    char nr = (char)raw_nr;
     int i;
 
-    sanitize_e820_map(raw, &nr);
-
-    (void)copy_e820_map(raw, nr);
-
-#ifdef __i386__
     /* 32-bit systems restricted to a 4GB physical memory map. */
     for ( i = 0; i < e820.nr_map; i++ )
     {
@@ -335,7 +329,18 @@ static void __init machine_specific_memory_setup(
             e820.nr_map = i + 1;                
         }            
     }
+}
+#else
+#define clip_4gb() ((void)0)
 #endif
+
+static void __init machine_specific_memory_setup(
+    struct e820entry *raw, int raw_nr)
+{
+    char nr = (char)raw_nr;
+    sanitize_e820_map(raw, &nr);
+    (void)copy_e820_map(raw, nr);
+    clip_4gb();
 }
 
 unsigned long init_e820(struct e820entry *raw, int raw_nr)
index 739dda8ef2dd640d1c8fc6716d39e5baa392fba7..69bca437d95c290733ef8fbd68c318bf94c7ff32 100644 (file)
@@ -148,6 +148,7 @@ unsigned long max_page;
 
 void __init init_frametable(void)
 {
+#ifdef __i386__
     unsigned long i, p;
 
     frame_table      = (struct pfn_info *)FRAMETABLE_VIRT_START;
@@ -164,6 +165,7 @@ void __init init_frametable(void)
     }
 
     memset(frame_table, 0, frame_table_size);
+#endif
 }
 
 void arch_init_memory(void)
index 537ebf15ba3dc8ccf0a978ee3c43caea27c54ac4..1ad91a14b565214c712a2fcc753311f759624f97 100644 (file)
@@ -25,12 +25,12 @@ SECTIONS
   .rodata : { *(.rodata) *(.rodata.*) } :text
   .kstrtab : { *(.kstrtab) } :text
 
-  . = ALIGN(16);               /* Exception table */
+  . = ALIGN(32);               /* Exception table */
   __start___ex_table = .;
   __ex_table : { *(__ex_table) } :text
   __stop___ex_table = .;
 
-  . = ALIGN(16);               /* Pre-exception table */
+  . = ALIGN(32);               /* Pre-exception table */
   __start___pre_ex_table = .;
   __pre_ex_table : { *(__pre_ex_table) } :text
   __stop___pre_ex_table = .;
@@ -57,7 +57,7 @@ SECTIONS
   __init_begin = .;
   .text.init : { *(.text.init) } :text
   .data.init : { *(.data.init) } :text
-  . = ALIGN(16);
+  . = ALIGN(32);
   __setup_start = .;
   .setup.init : { *(.setup.init) } :text
   __setup_end = .;
index 8a6b3a27ac699cd3ca09d89a5a0d10c2560975ba..f5072c3a05b79ce60d92715d0e72acfc9ac16554 100644 (file)
@@ -23,12 +23,12 @@ SECTIONS
   .rodata : { *(.rodata) *(.rodata.*) } :text
   .kstrtab : { *(.kstrtab) } :text
 
-  . = ALIGN(16);               /* Exception table */
+  . = ALIGN(32);               /* Exception table */
   __start___ex_table = .;
   __ex_table : { *(__ex_table) } :text
   __stop___ex_table = .;
 
-  . = ALIGN(16);                /* Pre-exception table */
+  . = ALIGN(32);                /* Pre-exception table */
   __start___pre_ex_table = .;
   __pre_ex_table : { *(__pre_ex_table) } :text
   __stop___pre_ex_table = .;
@@ -55,7 +55,7 @@ SECTIONS
   __init_begin = .;
   .text.init : { *(.text.init) } :text
   .data.init : { *(.data.init) } :text
-  . = ALIGN(16);
+  . = ALIGN(32);
   __setup_start = .;
   .setup.init : { *(.setup.init) } :text
   __setup_end = .;
index 180d83e37da4a68ede164f95939cecfdb3e2c714..3c96144256e09726f7d1f2a43bb8a7cf131338c9 100644 (file)
@@ -225,6 +225,7 @@ void synchronise_pagetables(unsigned long cpu_mask);
 #ifdef __x86_64__
 extern unsigned long *machine_to_phys_mapping;
 extern unsigned long *phys_to_machine_mapping;
+#define m2p_start_mfn virt_to_phys(machine_to_phys_mapping)
 #else
 /* Don't call virt_to_phys on this: it isn't direct mapped.  Using
    m2p_start_mfn instead. */
index abba7bdf12997b63753f3e690b260f3288be328a..4b6fec3ece6f99bbdd74f56a5e576f7b4b39ce4b 100644 (file)
@@ -115,6 +115,7 @@ typedef u64 tsc_timestamp_t; /* RDTSC timestamp */
  */
 typedef struct {
 #define ECF_I387_VALID (1<<0)
+#define ECF_VMX_GUEST  (2<<0)
     unsigned long flags;
     execution_context_t cpu_ctxt;           /* User-level CPU registers     */
     char          fpu_ctxt[512];            /* User-level FPU registers     */